<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.hbyj.util.ChangeTool"%>
<%@page import="com.hbyj.hbm.vo.Members"%>
<%@page import="com.hbyj.hbm.vo.MemberRole"%>
<%@page import="com.hbyj.hbm.vo.Roles"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Members mbInfo = (Members)request.getSession().getAttribute("SysUser");
Set set = mbInfo.getMemberRoles();
Iterator it = set.iterator();
MemberRole mr = (MemberRole)it.next();
Roles role = mr.getRoles();//拿到角色信息
String roleName = role.getName();
String lyCode = "";
try{
	lyCode = mbInfo.getLyCode();
}catch(Exception e){
	 response.sendRedirect("login.jsp");
	 return;
}

SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date datetime = new Date();
String time = date.format(datetime);

int flag = ChangeTool.ChangeArea(lyCode).length();
String shengName = "";String shiName = "";String xianName = "";
String shengCode = "";String shiCode = "00";String xianCode = "00";
if(flag==2){
	shengCode = lyCode;
	shengName = ChangeTool.getFinalValue(lyCode);
}else if(flag==4){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
}else if(flag==6){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
	xianCode = lyCode;
	xianName = ChangeTool.getFinalValue(xianCode);
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">   
  <head>
    <base href="<%=basePath%>">
    
    <title>值班记录维护</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="style/zbCss/pageTable.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="style/defaultStyle.css" />
<link href="style/zbCss/easyui_new.css" rel="stylesheet" type="text/css" />
		<link href="style/zbCss/icon.css" rel="stylesheet" type="text/css" />
		<script src="js/yjzsfunctiondlg/zbgl.js"  type="text/javascript"></script>
		<script src="lib/data.js" type="text/javascript"></script>
		<script src="lib/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="lib/easyui/jquery.easyui.min_new.js" type="text/javascript" ></script>
			<script type="text/javascript"src="My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
		$(document).ready(function () {
               	setOption('china','sheng_zbjl');
                $("#sheng_zbjl").attr("disabled","disabled");
                setSltDefaultVal("sheng_zbjl",<%=shengCode%>);
                changeShenItem(document.getElementById("sheng_zbjl").value,'shi_zbjl');
                initTblZBJL('<%=roleName%>');//初始化值班记录datagrid
                //值班人员详情对话框
                $('#detailsDialog_zbjl').dialog({
					draggable : true,
					top : 50,
					left : 100,
					title : "值班记录详情",
					collapsible : true
				});
                $("#detailsDialog_zbjl").dialog("close");
                })
		</script>
  </head>
  
  <body>
    <div id="wrapper">
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				style="margin-top: 0;">
				<tr>
					<td height="24" valign="middle" class="tab_title04">
						&nbsp;&nbsp;
						<img src="style/zbCss/images/icon_new.gif" width="12" height="16"
							align="middle" />
						&nbsp;&nbsp;值班值班记录维护
					</td>
				</tr>
			</table>
			
			
				<fieldset>
					<legend>
						值班记录
					</legend>
					<table class="tab01">
						<colgroup>
							<col width="15%" />
							<col width="13%" />
							<col width="12%" />
							<col width="9%" />
							<col width="16%" />
							<col width="35%" />
						</colgroup>
						<tr>
							<td class="tad_td01" style="width: 80px" nowrap>
							省:
						</td>
						<td style="width: 200px" nowrap>
							<select id="sheng_zbjl" onchange="changeShenItem(this.value,'shi_zbjl')"><option  selected="selected" value="" >请选择省</option></select>
						</td>
							<td class="tad_td01">
								市
							</td>
							<td>
							<select id="shi_zbjl" onchange="changeShiItem(this.value,'xian_zbjl')"><option  selected="selected" value="">请选择市</option></select>
							</td>
							<td class="tad_td01">
								县
							</td>
							<td>
								<select id="xian_zbjl" ><option  selected="selected" value="">请选择县</option></select>

							</td>
							
						</tr>
						<tr>
								<td class="tad_td01" nowrap>
									值班人员姓名：
								</td>
								<td style="width: 100px;">
									<input id="qName_zbjl" type="text">
								</td>
								<td class="tad_td01" nowrap>
									值班时间（起）
								</td>
								<td style="width: 100px;">
									<input id="startTime_zbjl"  class="Wdate" type="text" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" value="<%=ChangeTool.getBetweenTime()[0]%> 00:00:00"/>
								</td>
								<td class="tad_td01" nowrap>
									值班时间（止）
								</td>
								<td style="width: 100px;">
									<input id="endTime_zbjl" class="Wdate" type="text" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" value="<%=ChangeTool.getBetweenTime()[1]%> 23:59:00"/>
								</td>
								<td>
									<input type="button" id="queryBtn_zbry" value="查询" class="btn_2z"
										onclick="queryBtn_zbjl();" />
								</td>
					</table>
				</fieldset>
		<table id="tblZBJL" width="820px" height="450px"></table>
		</div>
		<div  id="detailsDialog_zbjl" style="width:580px;height:300px;" >
	<table >
	<input type="hidden" id="yjcz04id"/>
	<input type="hidden" id="yjcz04000"/>
	<tr><td>值班人员</td><td><input type="text" id="yjcz04020"/></td></tr>
	<tr><td>值班日期（起）</td>
	<td><input class="Wdate" 
	 onfocus="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" type="text" id="yjcz04093"/></td>
	 <td>值班日期（止）</td>
	 <td><input class="Wdate" type="text" id="yjcz04094"  onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"/></td></tr>
	<tr><td>记录类别</td><td colspan="3"><input type="radio" name="leibie" class="leibie" value="0">无灾&nbsp;<input type="radio" name="leibie" class="leibie" value="1">有灾&nbsp;<input type="radio" name="leibie" class="leibie" value="2">其他&nbsp;</td></tr>
	<tr><td>值班日志</td><td colspan="3"><textarea  id="yjcz04092" style='width:100%;height: 60px' /></textarea></td></tr>
	<tr><td>应急处置</td><td colspan="3"><textarea  id="yjcz04095" style='width:100%;height: 60px' /></textarea></td></tr>
	<tr id="btnTr">
	
	<td colspan="2" align="right"><input id="submitBtn_zbjl"  type="button" value="保存" class="btn_2z"
					onclick="updateZBJL()" /></td>
					<td colspan="2"><input type="button" id="resetBtn_zbjl" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
	</div>
  </body>
</html>
